import 'package:flutter/material.dart';
import '../../../widgets/AppColors.dart';

class BreakdownItem extends StatelessWidget {
  final Map<String, dynamic> data;
  const BreakdownItem({super.key, required this.data});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.only(top: 16, bottom: 16, right: 5, left: 5),
      margin: const EdgeInsets.symmetric(vertical: 4.0, horizontal: 8.0),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(8.0), // 圆角边框
        color: AppColors.cardColor, // 背景色
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Row(
            children: [
              Image(
                  image:
                      AssetImage("assets/images/centre/${data['icon']}.png")),
              SizedBox(width: 5),
              Text(
                data['malContent'] ?? '',
                style: TextStyle(fontSize: 15, color: AppColors.textPrimary),
              ),
            ],
          ),
          Text(
            data['highOrLow'] ?? '',
            style: TextStyle(fontSize: 15, color: Color(0xFFFCAA3F)),
          ),
          Text(
            data['recordTime'] ?? '',
            style: TextStyle(fontSize: 15, color: AppColors.textSecondary),
          ),
        ],
      ),
    );
  }
}
